const app = getApp();
Page({
  data: {
    nowCity: "",
    courseData: [
      {
        name: "寒假小班西安数学培训班（七大能力）",
        startTime: "一期下午15：30-17：00",
        timeSpan: "2020-01-16 至 2020-01-22",
        addr: "雁塔西路教学点",
        mode: "0",
        teacher: "李现",
        cost: "￥1151",
        teacherImg: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg"
      },
      {
        name: "寒假小班西安英文培训班（七大能力）",
        startTime: "一期下午15：30-17：00",
        timeSpan: "2020-01-16 至 2020-01-22",
        addr: "雁塔东路教学点",
        mode: "1",
        teacher: "杨幂",
        cost: "￥2151",
        teacherImg: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg"
      },
      {
        name: "寒假小班西安历史培训班（七大能力）",
        startTime: "一期下午15：30-17：00",
        timeSpan: "2020-01-16 至 2020-01-22",
        addr: "雁塔东路教学点",
        mode: "0",
        teacher: "杨颖",
        cost: "￥1351",
        teacherImg: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg"
      }
    ],
    searchVal:""
  },
  changCity() {
    wx.navigateTo({
      url: '/pages/component/city/city'
    })
  },
  onLoad(option){
    let search = option.search;
    this.setData({
      searchVal: search
    })
    console.log(search);
  },
  onShow() {
    if (app.globalData.selectedCity.name != undefined) {
      this.setData({
        nowCity: app.globalData.selectedCity.name
      })
    } else {
      this.setData({
        nowCity: "西安"
      })
    }
    // console.log(app.globalData.selectedCity.name)
  },
})